home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / CERY8U (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  2.2 KB  |  52 lines

  1. package com.sun.java.swing.plaf.basic;
  2.  
  3. import com.sun.java.swing.ListSelectionModel;
  4. import com.sun.java.swing.event.ListDataEvent;
  5. import com.sun.java.swing.event.ListDataListener;
  6. import java.io.Serializable;
  7.  
  8. public class BasicListUI$DataListener implements ListDataListener, Serializable {
  9.    // $FF: synthetic field
  10.    BasicListUI this$0;
  11.  
  12.    public void intervalAdded(ListDataEvent e) {
  13.       this.this$0.updateLayoutStateNeeded = 1;
  14.       int minIndex = Math.min(e.getIndex0(), e.getIndex1());
  15.       int maxIndex = Math.max(e.getIndex0(), e.getIndex1());
  16.       ListSelectionModel sm = this.this$0.list.getSelectionModel();
  17.       if (sm != null) {
  18.          sm.insertIndexInterval(minIndex, maxIndex - minIndex, true);
  19.       }
  20.  
  21.       int y = Math.max(0, this.this$0.convertRowToY(minIndex));
  22.       int h = this.this$0.list.getHeight() - y;
  23.       this.this$0.list.revalidate();
  24.       this.this$0.list.repaint(0, y, this.this$0.list.getWidth(), h);
  25.    }
  26.  
  27.    public void intervalRemoved(ListDataEvent e) {
  28.       this.this$0.updateLayoutStateNeeded = 1;
  29.       ListSelectionModel sm = this.this$0.list.getSelectionModel();
  30.       if (sm != null) {
  31.          sm.removeIndexInterval(e.getIndex0(), e.getIndex1());
  32.       }
  33.  
  34.       int minIndex = Math.min(e.getIndex0(), e.getIndex1());
  35.       int y = Math.max(0, this.this$0.convertRowToY(minIndex));
  36.       int h = this.this$0.list.getHeight() - y;
  37.       this.this$0.list.revalidate();
  38.       this.this$0.list.repaint(0, y, this.this$0.list.getWidth(), h);
  39.    }
  40.  
  41.    public void contentsChanged(ListDataEvent e) {
  42.       this.this$0.updateLayoutStateNeeded = 1;
  43.       this.this$0.list.revalidate();
  44.       this.this$0.list.repaint();
  45.    }
  46.  
  47.    // $FF: synthetic method
  48.    public BasicListUI$DataListener(BasicListUI this$0) {
  49.       this.this$0 = this$0;
  50.    }
  51. }
  52.